package com.ksd.common.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.io.File;

/**
 * 读取项目相关配置
 * 
 * @author ruoyi
 */
@Component
@ConfigurationProperties(prefix = "playcontrol")
public class PlayControlConfig
{
    /** 项目名称 */
    private static String name;

    /** 版本 */
    private static String version;

    /** 版权年份 */
    private String copyrightYear;

    /** 上传路径 */
    private static String profile;
    private static String nginxRootPath;
    private static String mappingPath;
    private static String usbDiskPath;


    /** 获取地址开关 */
    private static boolean addressEnabled;

    private static String xshellPath;
    private static String jarPath;
    private static String vuePath;
    private static String byoFilePath; //服务器自带
    private static String hardDiskFilePath; //硬盘地址
    private static String diskNginxRootPath;
    private static String diskMappingPath;

    /** 修改网口的网络配置地址*/
    private static String networkX86Path;
    private static String channelOneIpStart;
    private static String channelTwiceIpStart;
    private static String channelPort;
    private static String channelUrlStart;
    private static String user;
    private static String password;
    private static String token;
    private static String selectSysChannelListCount;
    private static String selectSysChannelSingleCount;

    public static String getDiskNginxRootPath() {
        return diskNginxRootPath;
    }

    public void setDiskNginxRootPath(String diskNginxRootPath) {
        PlayControlConfig.diskNginxRootPath = diskNginxRootPath;
    }

    public static String getDiskMappingPath() {
        return diskMappingPath;
    }

    public void setDiskMappingPath(String diskMappingPath) {
        PlayControlConfig.diskMappingPath = diskMappingPath;
    }

    public static String getByoFilePath() {
        return byoFilePath;
    }

    public void setByoFilePath(String byoFilePath) {
        PlayControlConfig.byoFilePath = byoFilePath;
    }

    public static String getHardDiskFilePath() {
        return hardDiskFilePath;
    }

    public void setHardDiskFilePath(String hardDiskFilePath) {
        PlayControlConfig.hardDiskFilePath = hardDiskFilePath;
    }

    public static String getSelectSysChannelSingleCount() {
        return selectSysChannelSingleCount;
    }

    public static String getVuePath() {
        return vuePath;
    }

    public void setVuePath(String vuePath) {
        PlayControlConfig.vuePath = vuePath;
    }

    public static String getJarPath() {
        return jarPath;
    }

    public void setJarPath(String jarPath) {
        PlayControlConfig.jarPath = jarPath;
    }

    public void setSelectSysChannelSingleCount(String selectSysChannelSingleCount) {
        PlayControlConfig.selectSysChannelSingleCount = selectSysChannelSingleCount;
    }

    public static String getSelectSysChannelListCount() {
        return selectSysChannelListCount;
    }

    public void setSelectSysChannelListCount(String selectSysChannelListCount) {
        PlayControlConfig.selectSysChannelListCount = selectSysChannelListCount;
    }

    public static String getUser() {
        return user;
    }

    public void setUser(String user) {
        PlayControlConfig.user = user;
    }

    public static String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        PlayControlConfig.password = password;
    }

    public static String getToken() {
        return token;
    }

    public void setToken(String token) {
        PlayControlConfig.token = token;
    }

    public static String getChannelUrlStart() {
        return channelUrlStart;
    }

    public void setChannelUrlStart(String channelUrlStart) {
        PlayControlConfig.channelUrlStart = channelUrlStart;
    }

    public static String getChannelPort() {
        return channelPort;
    }

    public void setChannelPort(String channelPort) {
        PlayControlConfig.channelPort = channelPort;
    }

    public static String getMappingPath() {
        return mappingPath;
    }

    public void setMappingPath(String mappingPath) {
        PlayControlConfig.mappingPath = mappingPath;
    }

    public static String getUsbDiskPath() {
        return usbDiskPath;
    }

    public void setUsbDiskPath(String usbDiskPath) {
        PlayControlConfig.usbDiskPath = usbDiskPath;
    }

    public static String getNginxRootPath() {
        return nginxRootPath;
    }

    public void setNginxRootPath(String nginxRootPath) {
        PlayControlConfig.nginxRootPath = nginxRootPath;
    }

    public static String getNetworkX86Path() {
        return networkX86Path;
    }

    public void setNetworkX86Path(String networkX86Path) {
        PlayControlConfig.networkX86Path = networkX86Path;
    }

    public static String getChannelOneIpStart() {
        return channelOneIpStart;
    }

    public void setChannelOneIpStart(String channelOneIpStart) {
        PlayControlConfig.channelOneIpStart = channelOneIpStart;
    }

    public static String getChannelTwiceIpStart() {
        return channelTwiceIpStart;
    }

    public void setChannelTwiceIpStart(String channelTwiceIpStart) {
        PlayControlConfig.channelTwiceIpStart = channelTwiceIpStart;
    }

    public static String getXshellPath() {
        return xshellPath;
    }

    public  void setXshellPath(String xshellPath) {
        PlayControlConfig.xshellPath = xshellPath;
    }

    /** 验证码类型 */
    private static String captchaType;

    public static String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        PlayControlConfig.name = name;
    }

    public static String getVersion()
    {
        return version;
    }

    public void setVersion(String version)
    {
        PlayControlConfig.version = version;
    }

    public String getCopyrightYear()
    {
        return copyrightYear;
    }

    public void setCopyrightYear(String copyrightYear)
    {
        this.copyrightYear = copyrightYear;
    }

    public static String getProfile()
    {
        return profile;
    }

    public void setProfile(String profile)
    {
        PlayControlConfig.profile = profile;
    }

    public static boolean isAddressEnabled()
    {
        return addressEnabled;
    }

    public void setAddressEnabled(boolean addressEnabled)
    {
        PlayControlConfig.addressEnabled = addressEnabled;
    }

    public static String getCaptchaType() {
        return captchaType;
    }

    public void setCaptchaType(String captchaType) {
        PlayControlConfig.captchaType = captchaType;
    }

    /**
     * 获取导入上传路径
     */
    public static String getImportPath()
    {
        return getProfile() + "/import";
    }

    /**
     * 获取头像上传路径
     */
    public static String getAvatarPath()
    {
        return getProfile() + "/avatar";
    }

    /**
     * 获取下载路径
     */
    public static String getDownloadPath()
    {
        return getProfile() + "/download/";
    }

    /**
     * 获取上传路径
     */
    public static String getUploadPath()
    {
        return getProfile() + File.separator+"upload";
    }
}
